<extend name="./Public/View/base.html" />
<block name="styles"></block>
<block name="header">
	<include file="./Public/View/header.html" />
</block>
<block name="main">
	<div class="main layui-clear">
		<div class="wrap">
			<div class="content detail">
				<div data-id="{$question.id}" class="fly-panel detail-box">
					<h1>{$question.question_title}</h1>
					<div class="fly-tip fly-detail-hint" data-id="{{rows.id}}">
						<span class="fly-tip-stick">置顶帖</span>
						<span class="fly-tip-jing">精帖</span>
						<span>未结贴</span>
						<!-- <span class="fly-tip-jie">已采纳</span> -->

						<!-- <span class="jie-admin" type="del" style="margin-left: 20px;">删除</span>
				          <span class="jie-admin" type="set" field="stick" rank="1">置顶</span> 
				          <span class="jie-admin" type="set" field="stick" rank="0" style="background-color:#ccc;">取消置顶</span>
				          <span class="jie-admin" type="set" field="status" rank="1">加精</span> 
				          <span class="jie-admin" type="set" field="status" rank="0" style="background-color:#ccc;">取消加精</span> -->

						<div class="fly-list-hint">
							<i class="iconfont" title="回答">&#xe60c;</i>{$question.question_comment}
							<i class="iconfont" title="人气">&#xe60b;</i>{$question.question_view}
						</div>
					</div>
					<div class="detail-about">
						<a class="jie-user" href="">
							<img src="{$question.user_image}" alt="">
							<cite>
              					{$question.user_name}
				              	<em>{$question.question_time}</em>
				            </cite>
						</a>
						<div class="detail-hits" data-id="{{rows.id}}">
							<span style="color:#FF7200">悬赏：{$question.question_award}飞吻</span>
							<span class="layui-btn layui-btn-mini jie-admin" type="edit"><a href="/jie/edit/{{rows.id}}">编辑此贴</a></span>
							<span class="layui-btn layui-btn-mini jie-admin " type="collect" data-type="add">收藏</span>
							<!--<span class="layui-btn layui-btn-mini jie-admin  layui-btn-danger" type="collect" data-type="add">取消收藏</span>-->
						</div>
					</div>

					<div class="detail-body photos" style="margin-bottom: 20px;">
						{$question.question_content}
					</div>
				</div>

				<div class="fly-panel detail-box" style="padding-top: 0;">
					<a name="comment"></a>
					<ul class="jieda photos" id="jieda">
						<notempty name="beast">
						<li data-id="{$beast.id}" class="jieda">
							<a name=""></a>
							<div class="detail-about detail-about-reply">
								<a class="jie-user" href="">
									<img src="{$beast.user_image}" alt="" layer-index="1">
									<cite>
			                  <i>{$beast.user_name}</i>
			                </cite>
								</a>
								<div class="detail-hits">
									<span>{$beast.answer_time}</span>
								</div>
								<i class="iconfont icon-caina" title="最佳答案"></i>
							</div>
							<div class="detail-body jieda-body">
								{$beast.answer_content}
							</div>
							<div class="jieda-reply">
								<span class="jieda-zan" type="zan"><i class="iconfont icon-zan"></i><em>{$beast.zan}</em></span>
								<span type="reply"><i class="iconfont icon-svgmoban53"></i>回复</span>

							</div>
						</li>
						</notempty>
						<volist name="comment" id="vo">
							<li data-id="{$vo.id}">
								<a name="item-121212121212"></a>
								<div class="detail-about detail-about-reply">
									<a class="jie-user" href="">
										<img src="{$vo.user_image}" alt="">
										<cite>
						                  <i>{$vo.user_name}</i>
						                  <em style="color:#FF9E3F">活雷锋</em>
						                   <!-- <em>(楼主)</em>
						                  <em style="color:#5FB878">(管理员)</em>
						                  <em style="color:#FF9E3F">（活雷锋）</em>
						                  <em style="color:#999">（该号已被封）</em> -->
						                </cite>
									</a>
									<div class="detail-hits">
										<span>{$vo.answer_time}</span>
									</div>
								</div>
								<div class="detail-body jieda-body">
									{$vo.answer_content}
								</div>
								<div class="jieda-reply">
									<span class="jieda-zan" type="zan"><i class="iconfont icon-zan"></i><em>{$vo.zan}</em></span>
									<span type="reply"><i class="iconfont icon-svgmoban53"></i>回复</span>
									<notempty name="is_author">
										<div class="jieda-admin">
											<span type="edit">编辑</span>
											<span type="del"><a href="__URL__/deleteComment?cid={$vo.id}">删除</a></span>
											<span class="jieda-accept" type="accept"><a href="__URL__/setBeast?cid={$vo.id}&qid={$question.id}">采纳</a></span>
										</div>
									</notempty>
								</div>
							</li>
						</volist>
						<empty name="comment">
							<empty name="beast">
								<li class="fly-none">没有任何回答</li>
							</empty>
						</empty>

					</ul>

					<div class="layui-form layui-form-pane">
						<form action="__URL__/comment" method="post">
							<div class="layui-form-item layui-form-text">
								<div class="layui-input-block">
									<textarea id="L_content" name="content" required lay-verify="required" placeholder="我要回答" class="layui-textarea fly-editor" style="height: 150px;"></textarea>
								</div>
							</div>
							<div class="layui-form-item">
								<input type="hidden" name="qid" value="{$question.id}">
								<input type="hidden" name="uid" value="{$Think.session.uid}">
								<button class="layui-btn" lay-filter="*" lay-submit>提交回答</button>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>

		<div class="edge">
			<dl class="fly-panel fly-list-one">
				<dt class="fly-panel-title">最近热帖</dt>
				<volist id="vo" name="hot" >
				<dd>
					<a href="__URL__/detail?q={$vo.id}">{$vo.question_title}</a>
					<span><i class="iconfont">&#xe60b;</i>{$vo.question_view}</span>
				</dd>
				</volist>
			</dl>

			<dl class="fly-panel fly-list-one">
				<dt class="fly-panel-title">近期热议</dt>
				<volist id="vo" name="hotComment" >
				<dd>
					<a href="__URL__/detail?q={$vo.id}">{$vo.question_title}</a>
					<span><i class="iconfont">&#xe60c;</i>{$vo.question_comment}</span>
				</dd>
				</volist>
			</dl>
		</div>
	</div>

</block>
<block name="footer">
	<include file="./Public/View/footer.html" />
</block>
<block name="scripts">
	<script type="text/javascript">
		
		$("span.jieda-zan").click(function(e){
			var qid = $(".detail-box").attr("data-id");
			var cid = $(this).parents("li").attr("data-id");
			
			var _self = $(this);
			$.post("__URL__/like",{q:qid,c:cid},function(data){
				if(data.status == "ok"){
					if(data.action=="like"){
						_self.addClass("zanok");
					}else{
						_self.removeClass("zanok");
					}
					_self.children("em").text(data.count);
				}else{
					alert("请登录！");
				}
			});
		});
	</script>
</block>